<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>AutoUpdate Documentation</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style4 {font-family: Arial, Helvetica, sans-serif; font-size: smaller; }
-->
</style>
</head>

<body>
  
<a name="FMSAUC_Version" id="FMSAUC_Version"></a>
<h1>FMSAUC_Version( ConstantInteger )</h1>
<dl>
  <dt> Description </dt>
  <dd> This function returns the name and version string from the Auto Update plug-in located in the user's FileMaker Extensions folder on the client computer. If no string is found, FileMaker assumes the Audo Update plug-in is missing or isn't enabled on the client computer.</dd>
  <dt> Parameters </dt>
  <dd> <span class="param">ConstantInteger</span> – 0 </dd>
  <dt> Examples </dt>
  <dd> <span class="code">FMSAUC_Version( 0 )</span><span class="code"><br />
  </span> </dd>
</dl>

<a name="FMSAUC_FindPlugin" id="zippScript_Version2"></a>
<h1>FMSAUC_FindPlugin( PluginName ) </h1>
<dl>
  <dt> Description </dt>
  <dd> This function returns a string listing the plug-in versions located in the FileMaker Server AutoUpdate folder or the default database folder. If the plug-in can't be found, the function returns <span class="code">-1</span> (negative 1).<br />
    <br />
  FileMaker Server looks for the plug-in in two places. First, it searches the AutoUpdate folder located in the same folder that contains the hosted database. If the file is not found there, it searches for an AutoUpdate folder located in the FileMaker Server default database folder.</dd>
  <dt> Parameters </dt>
  <dd> <span class="param">PluginName</span> – the name of the plug-in file. The parameter must be enclosed in quotes.</dd>
  <dt>Data Type Returned</dt>
  <dd>Text </dd>
  <dt> Example </dt>
  <dd> The following example shows how to specify the external function FMSAUC_FindPlugin within a Set Field script step. The Set Fiueld script step allows you to return the result of a calculation in a single field. For more information about script steps and FileMaker Pro functions, see FileMaker Pro Help.<br />
      <br />
    <span class="code">Set Field [ dbname::Remote_Version; FMSAUC_FindPlugin( &quot;SamplePlugin&quot; )]<br />  
    </span><br />
    This example returns versions in the following format:<br />
      <br />
      <span class="code">1.0 1.2 1.5 2.0 3.3 …<br />
      </span> </dd>
</dl>

<a name="FMSAUC_UpdatePlugin" id="zippScript_Version"></a>
<h1>FMSAUC_UpdatePlugin( PluginName_Version) </h1>
<dl>
  <dt> Description </dt>
  <dd> This function downloads the specified plug-in or support file from the server computer to the client computer. FileMaker Server looks for the plug-in in two places. First, it searches the AutoUpdate folder located in the same folder that contains the hosted database. If the file is not found there, it searches for an AutoUpdate folder located in the FileMaker Server default database folder.</dd>
  <dt> Parameters </dt>
  <dd> <span class="param">PluginName_Version</span> – the name of the plug-in or support file that you want to download and the plug-in version number. The parameter must be enclosed in quotes.</dd>
  <dt>Note</dt>
  <dd>There must be a space between the plug-in name and the version number.</dd>
  <dt>Data Type Returned</dt>
  <dd>Text </dd>
  <dt> Example </dt>
  <dd> <span class="code">FMSAUC_UpdatePlugin( &quot;SamplePlugin 1.5&quot; )</span><br />
    <br />
    If there is a file with the same name in the current user's FileMaker Extensions folder, it is moved to the Extensions/Saved folder. If this file is a plug-in, it is disabled in FileMaker Pro before it is moved. The newly downloaded file is then copied to the current user's FileMaker Extensions folder and enabled, if the downloaded file is a plug-in.<br />
    <br />
    If the file successfully downloads, the function returns <span class="code">0</span> (zero). Otherwise, the function returns an error code listed in the following table.<br />
    <br />
    If an error occurs during the downloading process, the FMSAUC_UpdatePlugin function attempts to restore all files to the state they were in when the function call executed. If an existing plug-in was disabled and moved to the Extensions/Saved folder, it is moved back to the current user's FileMaker Extensions folder and re-enabled in FileMaker Pro on the client computer.<br />
    <br />
    <table width="100%" border="0">
      <tr>
        <th width="9%" scope="col"><div align="left" class="style4">Error code</div></th>
        <th width="91%" scope="col"><div align="left" class="style4">Description</div></th>
      </tr>
      <tr>
        <td>–1</td>
        <td>The file to be downloaded is missing from the temporary folder.</td>
      </tr>
      <tr>
        <td>–2</td>
        <td>The Extensions/Saved folder to contain the backup of the outdated plug-in or support file couldn't be created on the client computer.</td>
      </tr>
      <tr>
        <td>–3</td>
        <td>The file to be replaced on the client computer couldn't be deleted from the current user's FileMaker Extensions folder.</td>
      </tr>
      <tr>
        <td>–4</td>
        <td>The file to be replaced couldn't be copied to the current user's FileMaker Extensions folder.</td>
      </tr>
      <tr>
        <td>–5</td>
        <td>The downloaded file can't be copied to the current user's FileMaker Extensions folder.</td>
      </tr>
      <tr>
        <td>–6</td>
        <td>The download file must be a plug-in file.</td>
      </tr>
      <tr>
        <td>3</td>
        <td>The Auto Updated plug-in is disabled in the FileMaker Server Admin Console.</td>
      </tr>
      <tr>
        <td>6</td>
        <td>An error occurred on the computer running FileMaker Server as the file was being downloaded.</td>
      </tr>
      <tr>
        <td>100</td>
        <td>The external function definition for FMSAUC_UpdatePlugIn contains an invalid or empty parameter.</td>
      </tr>
      <tr>
        <td>101</td>
        <td>The function call from the client computer to the computer running FileMaker Server failed. The server computer might be running a previous version of FileMaker Server.</td>
      </tr>
    </table>
  </dd>
</dl>
<br />
</body>
</html>
